#include <stdio.h>

double factorial(int n);

int main(void)
{
	int m;
	double s;
	
	printf("Input a positive integer: ");
	scanf("%d", &m);
	s = factorial(m);
	printf("%d! = %.0f\n", m, s);
	
	return 0;
}

double factorial(int n)
{
	double r;

	if (n > 1)
		r = n * factorial(n -1);
	else
		r = 1;

	return r;
}